{"componentChunkName":"component---node-modules-gatsby-theme-mdx-deck-src-templates-deck-js","path":"/xhr","matchPath":"/xhr/*","result":{"data":{"deck":{"id":"879818ff-25a9-5e63-b1b3-ccc4e06e8919","body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar theme = shadesOfPurple;\nvar _frontmatter = {};\nvar layoutProps = {\n  theme: theme,\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", null, \"XHR \\uD83D\\uDC4B\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.linkedin.com/in/ragavkumarv/\"\n  }, \"@ragavkumarv\")), mdx(\"hr\", null), mdx(CodeSurfer, {\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  // Creating the request\\n  const xhr = new XMLHttpRequest();\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  // Creating the request\\n  const xhr = new XMLHttpRequest();\\n  // Reading the data\\n  // METHOD, URL\\n  // API or endpoint -> Can access data\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  // Creating the request\\n  const xhr = new XMLHttpRequest();\\n  // Reading the data\\n  // METHOD, URL\\n  // API or endpoint -> Can access data\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  // Creating the request\\n  const xhr = new XMLHttpRequest();\\n  // Reading the data\\n  // METHOD, URL\\n  // API or endpoint -> Can access data\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n\\n  xhr.responseType = \\\"json\\\"; // data format\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  // Creating the request\\n  const xhr = new XMLHttpRequest();\\n  // Reading the data\\n  // METHOD, URL\\n  // API or endpoint -> Can access data\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n\\n  xhr.responseType = \\\"json\\\"; // data format\\n\\n  xhr.onload = () => {};\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  // Creating the request\\n  const xhr = new XMLHttpRequest();\\n  // Reading the data\\n  // METHOD, URL\\n  // API or endpoint -> Can access data\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n\\n  xhr.responseType = \\\"json\\\"; // data format\\n\\n  xhr.onload = () => {\\n    const countries = xhr.response;\\n  };\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  // Creating the request\\n  const xhr = new XMLHttpRequest();\\n  // Reading the data\\n  // METHOD, URL\\n  // API or endpoint -> Can access data\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n\\n  xhr.responseType = \\\"json\\\"; // data format\\n\\n  xhr.onload = () => {\\n    const countries = xhr.response;\\n    const countryNames = countries.map((country) => country.name.common);\\n    console.log(\\\"List of country names\\\", countryNames);\\n  };\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  const xhr = new XMLHttpRequest();\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n  xhr.responseType = \\\"json\\\"; // data format\\n  xhr.onload = () => {\\n    const countries = xhr.response;\\n    const countryNames = countries.map((country) => country.name.common);\\n    console.log(\\\"List of country names\\\", countryNames);\\n  };\\n};\\n\\ngetCountries();\\n\"))), mdx(\"hr\", null), mdx(CodeSurferColumns, {\n    themes: [vsDark, github, shadesOfPurple],\n    mdxType: \"CodeSurferColumns\"\n  }, mdx(Step, {\n    mdxType: \"Step\"\n  }, mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  const xhr = new XMLHttpRequest();\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n  xhr.responseType = \\\"json\\\"; // data format\\n  xhr.onload = () => {\\n    const countries = xhr.response;\\n    const countryNames = countries.map((country) => country.name.common);\\n    console.log(\\\"List of country names\\\", countryNames);\\n  };\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"Task I\\\"\",\n    \"title\": \"\\\"Task\",\n    \"I\\\"\": true\n  }, \"Find all countries that speak spanish\\nExpected output\\n\\n[\\\"Spain\\\", \\\"Mexico\\\"...]\\n\"))), mdx(Step, {\n    mdxType: \"Step\"\n  }, mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"XHR\\\"\",\n    \"title\": \"\\\"XHR\\\"\"\n  }, \"const getCountries = () => {\\n  const xhr = new XMLHttpRequest();\\n  xhr.open(\\\"GET\\\", \\\"https://restcountries.com/v3.1/all\\\"); //open\\n  xhr.send(); // send\\n  xhr.responseType = \\\"json\\\"; // data format\\n  xhr.onload = () => {\\n    const countries = xhr.response;\\n    const countryNames = countries.map((country) => country.name.common);\\n    console.log(\\\"List of country names\\\", countryNames);\\n  };\\n};\\n\\ngetCountries();\\n\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\",\n    \"metastring\": \"title=\\\"Task II\\\"\",\n    \"title\": \"\\\"Task\",\n    \"II\\\"\": true\n  }, \"Find all countries >= 1_00_00_000 population\\nExpected output\\n\\n[\\\"India\\\", \\\"China\\\", \\\"Russia\\\" ...]\\n\")))), mdx(\"hr\", null), mdx(\"h1\", null, \"That's all folks \\uD83D\\uDE4B\\uD83C\\uDFFD\\u200D\\u2642\\uFE0F\"));\n}\n;\nMDXContent.isMDXComponent = true;"}},"pageContext":{"matchPath":"/xhr/*","id":"879818ff-25a9-5e63-b1b3-ccc4e06e8919","slug":"/xhr","title":"XHR 👋"}},"staticQueryHashes":[]}